Skip to content

Cross repo triggers how-to#9952

Open
rosieyohannan wants to merge 8 commits intomainfrom
DOCSS-2000-cross-repo-triggers
Open

Cross repo triggers how-to#9952
rosieyohannan wants to merge 8 commits intomainfrom
DOCSS-2000-cross-repo-triggers

Conversation

@rosieyohannan
Copy link
Contributor

@rosieyohannan rosieyohannan commented Feb 3, 2026

Written with Claude code for help with structure, use case and examples

Adds a how-to guide for setting up cross-repo triggers with two pathways, one in which the config is stored with the code and one in which a centralised config repo is used.

@rosieyohannan rosieyohannan marked this pull request as ready for review February 12, 2026 14:25
@rosieyohannan rosieyohannan requested review from a team as code owners February 12, 2026 14:25

*For this how-to guide we have chosen the following scenario:*

When you tag a new release of an internal library, CircleCI automatically runs tests in the repositories that consume that library. This validates that your library changes work correctly with dependent applications before you publish the release.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be just me, but when I first read it I thought it sounded like we're saying that this already happens by default.
As opposed to - "we want CircleCI to automatically run tests..."

Comment on lines +104 to +106
* `pipeline.git.tag`: The tag name that was created (for tag triggers). Empty string if not triggered by a tag.
* `pipeline.git.branch`: The branch name where the event occurred in the library repository.
* `pipeline.git.revision`: The specific commit SHA from the library repository.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested these? I don't think they are supposed to be right. If they are, there is something wrong :(
Afaik it should be:

  • pipeline.event.github.ref (this is valid both TAG and for BRANCH, it just depends on which one you are pushing. But I believe it's pushed with the prefix tag/{tagname} and refs/heads/{branchname}.
  • pipeline.event.context.github.sha (pipeline.event.context.github.after)

Everything that is prefixed with pipeline.git.* refers to the checkout source. Here you are trying to get data from the trigger source

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍 👍 I'm going to hold off on this PR until we have documented these here

* `pipeline.git.tag`: The tag name that was created (for tag triggers). Empty string if not triggered by a tag.
* `pipeline.git.branch`: The branch name where the event occurred in the library repository.
* `pipeline.git.revision`: The specific commit SHA from the library repository.
* `pipeline.trigger_parameters.github_app.repo_name`: The name of the library repository that triggered the pipeline.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is technically correct but we want to deprecate trigger parameters, we should use :
"pipeline.event.github.repository.name"

├── .circleci/
│ ├── consumer-config.yml
│ └── other-config.yml
----
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it'd be helpful to put a screenshot of what the trigger looks like at the bottom of the table. It would render very small, but I'm assuming users would be able to click and zoom in?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, now I've read more of the page - maybe it's better suited to the tabs where you have "Option 1: Config in consumer repository" and walk the user through setting it up


The trigger is now configured in CircleCI, but you also need to update your configuration file for your integration tests to run workflows for tags.

By default, *CircleCI does not run workflows for tags unless you explicitly specify tag filters*.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth a link to the config guide that talks about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants